package org.jeecg.modules.wlhy.hydriver.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.wlhy.hydriver.entity.DriverUserDTO;
import org.jeecg.modules.wlhy.hydriver.entity.HyDriver;
import org.jeecg.modules.wlhy.hydriver.entity.HyDriverDTO;
import org.jeecg.modules.wlhy.hydriver.entity.HySelectDriverDTO;
import org.jeecg.modules.wlhy.hydriver.vo.HyDriverVehicleVO;
import org.jeecg.modules.wlhy.hyvehicle.entity.HyVehicle;

import java.util.List;

/**
 * @Description: 司机管理
 * @Author: duanlikao
 * @Date:   2020-12-02
 * @Version: V1.0
 */
public interface HyDriverMapper extends BaseMapper<HyDriver> {

    HyDriver  getHyDriverByTelephone(@Param("telephone")  String telephone);

    int  deleteDriverById(@Param("id")  String id);

    HyDriver getDriverById(@Param("id")  String id);

    HyDriver   getHyDriverByUserId(@Param("userId") String userId);

    List<HyDriverVehicleVO> getDriverVehiclePageList(Page<HyDriverVehicleVO> page, @Param(Constants.WRAPPER) QueryWrapper<HyDriverVehicleVO> queryWrapper);


    List<DriverUserDTO> getDriverUserPageList(
            Page<DriverUserDTO> page,
            @Param(Constants.WRAPPER) QueryWrapper<DriverUserDTO> queryWrapper
    );

    List<HyDriverDTO> pageList(
            Page<HyDriverDTO> page,
            @Param(Constants.WRAPPER) QueryWrapper<HyDriverDTO> queryWrapper,
            @Param("customerId") String customerId
    );


    HyDriver selectByIdForUpdate(@Param("driverId")String driverId);

    List<HyVehicle> getDriverVehicleList(@Param("driverID") String driverID);

    int getDsDriverCount(@Param("customerId") String customerId);

    IPage<HySelectDriverDTO> getSelectPageList(Page<HySelectDriverDTO> page, @Param(Constants.WRAPPER)QueryWrapper<HyDriver> queryWrapper);

    IPage<HySelectDriverDTO> getMultipleSelectPageList(Page<HySelectDriverDTO> page, @Param(Constants.WRAPPER)QueryWrapper<HyDriver> queryWrapper);

    List<HyDriver> getDriverListByCarrierId(String id);
}
